<!DOCTYPE html>

<html>
<head>
  <title>EventRegistry</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  <link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
  <div id="container">
    <div id="background"></div>
    
      <ul id="jump_to">
        <li>
          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
          <a class="small" href="javascript:void(0);">+</a>
          <div id="jump_wrapper">
          <div id="jump_page">
            
              
              <a class="source" href="Event.coffee.html">
                Event.coffee.md
              </a>
            
              
              <a class="source" href="EventRegistry.coffee.html">
                EventRegistry.coffee.md
              </a>
            
              
              <a class="source" href="EventType.coffee.html">
                EventType.coffee.md
              </a>
            
              
              <a class="source" href="Subscriber.coffee.html">
                Subscriber.coffee.md
              </a>
            
              
              <a class="source" href="header.coffee.html">
                header.coffee.md
              </a>
            
          </div>
        </li>
      </ul>
    
    <ul class="sections">
        
        
        
        <li id="section-1">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-1">&#182;</a>
              </div>
              <h1 id="eventregistry">EventRegistry</h1>

            </div>
            
            <div class="content"><div class='highlight'><pre>	
	<span class="hljs-built_in">window</span>.EventRegistry = <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">EventRegistry</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Map</span>.<span class="hljs-title">To</span> <span class="hljs-title">EventType</span></span>
	
		<span class="hljs-attribute">constructor</span>: <span class="hljs-function"><span class="hljs-params">(eventtypes=[])</span> -&gt;</span>
			<span class="hljs-keyword">super</span> eventtypes
			
		<span class="hljs-attribute">register</span>: <span class="hljs-function"><span class="hljs-params">(args...)</span> -&gt;</span> <span class="hljs-property">@add</span> args...
		
		<span class="hljs-attribute">create</span>: Function.Returning(<span class="hljs-function">-&gt;</span> <span class="hljs-keyword">new</span> EventType) \
			<span class="hljs-function"><span class="hljs-params">(eventtype)</span> -&gt;</span> <span class="hljs-function"><span class="hljs-params">(key)</span> -&gt;</span> <span class="hljs-property">@add</span> key, eventtype
		
		<span class="hljs-attribute">subscribe</span>: Function.From<span class="hljs-function"><span class="hljs-params">(Object)</span> <span class="hljs-params">(subscriptions)</span> -&gt;</span>
			<span class="hljs-property">@get</span>(name).subscribe(subscriber) <span class="hljs-keyword">for</span> own name, subscriber <span class="hljs-keyword">of</span> subscriptions
		
		<span class="hljs-attribute">republish</span>: Function.From<span class="hljs-function"><span class="hljs-params">(Object)</span> <span class="hljs-params">(publications)</span> -&gt;</span>
			<span class="hljs-property">@get</span>(name).republished(eventtype) <span class="hljs-keyword">for</span> own name, eventtype <span class="hljs-keyword">of</span> publications</pre></div></div>
            
        </li>
        
    </ul>
  </div>
</body>
</html>
